<?php

namespace app\index\controller;

use app\index\model\Config;
use app\index\model\Webcity;
use think\Cache;
use think\Controller;
use think\View;

class CommonController extends Controller
{
    public function _initialize()
    {
        $config = Cache::get('config', null);
        if (is_null($config)) {
            $config = Config::where('id', '=', 1)->find();

            Cache::set('config', $config);
        }

        //分站城市
        $cityList=Webcity::where('is_open',1)->select();
        View::share('cityList',$cityList);
        View::share('config', $config);
    }

}